| Conditions | 6 |
| Paths | 5 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | export {getEncodingHeight, getBarcodePadding}; |
||
| 11 | function getBarcodePadding(textWidth, barcodeWidth, options){ |
||
| 12 | if(options.displayValue && barcodeWidth < textWidth){ |
||
| 13 | if(options.textAlign == "center"){ |
||
| 14 | return Math.floor((textWidth - barcodeWidth) / 2); |
||
| 15 | } |
||
| 16 | else if(options.textAlign == "left"){ |
||
| 17 | return 0; |
||
| 18 | } |
||
| 19 | else if(options.textAlign == "right"){ |
||
| 20 | return Math.floor(textWidth - barcodeWidth); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | return 0; |
||
| 24 | } |
||
| 25 |